<script type="text/javascript">
//$('#customer').change(function(){
	// var customervalue=$(this).val();
	 //document.getElementById('payondelivery').innerHTML='';
     //var url="__URL__/add/ajax/a";
     //$.ajax({
 	//	type: 'POST',
 	//	url:url,
 	//	data:{'customer':customervalue},
 	//	dataType:"json",
 	//	cache: false,
 	//	success: cus,
 	//	error: DWZ.ajaxError
 	//});
//});
     
     
     
     function cus(json)
     {
    	 
     	if (json.statusCode == DWZ.statusCode.ok)
     	  {
     		document.getElementById('payondelivery').innerHTML=json.data;
     	  }
     }
</script>





<div class="pageContent">

	<form method="post"	action="__URL__/BlockOutcontrol/insert/true/navTabId/BlockOutcontrol/callbackType/closeCurrent" class="pageForm required-validate"
		onsubmit="return validateCallback(this, dialogAjaxDone)">
		<input type="hidden" name="shipper" id="shipper">
		<input type="hidden" name="provider" id="provider"> 
		<input type="hidden" name="contractlogid" value="{$contractlogid}">
		<input type="hidden" name="tocontractlogid" value="{$tocontractlogid}">
		<input type="hidden" name="type" value="{$type}">
		<input type="hidden" name="operator" value="<?php echo $_SESSION[C(USER_AUTH_KEY)]?>"/> 
		<div class="pageFormContent" layoutH="58">
			<p class="unit">
				<label>订单号：</label> <input name="orders" type="text" readonly value="<?php echo date('YmdHis')?>" size="30" />
			</p>
			<!-- <div class="unit">
				<label>合同编号：</label> <input type="text" class="required"
					name="contractno">
			</div> -->
			<div id="div1" style="display: block">
				<p class="unit">
					<label style="margin-right: -10px;">发货方：</label> 
					<select name="shipper" id="shipper"	class="required combox">
						<option value="">请选择</option>
						<volist id="sub" name="subcompany"> 
						<option value="{$sub.subname}">{$sub.subname}</option>
						</volist>
					</select>
				</p>
				<p class="unit">
					<?php  
					 if(empty($customer)){
					?>
					<label style="margin-right: -10px;">客户：</label>
					<select name="customer" id="customer" class="required combox">
						<option value="" selected>请选择(必填)</option>
						<option value="-1,1">东明库</option>
						<option value="-2,2">南曹库</option>
						<option value="-3,3">金海库</option>
						<volist name="list4" id="vo">
						<option value="{$vo.id},{$vo.secondid}">{$vo.secondname}
						<eq name="vo.iscommon" value="0">-正常审批</eq>
				        <eq name="vo.iscommon" value="1">-款到卸车</eq>
				        <eq name="vo.iscommon" value="2">-特殊审批</eq>
						</option>
						</volist>
					</select>
					<?php 
					}else{
					?>
					<label >客户：</label>
					<?php
					if($payondelivery==1){
                       ?>
                       <span style='color:red;'>注意： 该客户为款到卸车</span>
                       <?php
                       }
					?>
					 <input type="hidden" name="customer" value ="{$customerid}">
                     <input type="text" name="customername" value ="{$customer}" readonly="readonly">
					<?php
					}
					?>
				</p>
				<div  id='payondelivery' style="display:inline;margin-left:20px;" ></div>
				<p class="unit">
				    <?php  
					 if(empty($provider)){
					?>
					<label style="margin-right: -10px;">供应商：</label>
					<select name="provider" id="provider" class="required combox">
						<option value="" selected>请选择(必填)</option>
						<option value="-1,1">东明库</option>
						<option value="-2,2">南曹库</option>
						<option value="-3,3">金海库</option>
						<volist name="list2" id="vo">
						<option value="{$vo.id},{$vo.secondid}">{$vo.secondname}</option>
						</volist>
					</select>
					<?php 
					}else{
					?>
					<label >供应商：</label>
					 <input type="hidden" name="provider" value ="{$providerid}">
                   <input type="text" name="providername" value ="{$provider}" readonly="readonly">
					<?php
					}
					?>
				</p>
			</div>
			<p class="unit">
				<label style="margin-right: -10px;">起运地：</label> 
				<select name="start" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="freight" id="vo">
					<option value="{$vo.startaddress}">{$vo.startaddress}</option>
					</volist>
				</select>
			</p>
			<p class="unit">
				<label style="margin-right: -10px;">目的地：</label> 
				<select name="destination" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="end" id="vo">
					<option value="{$vo.endaddress}">{$vo.endaddress}</option>
					</volist>
				</select>
			</p>
			<p class="unit">
				<label style="margin-right: -10px;">承运方：</label> 
				<select name="carrier" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="list3" id="vo">
					<option value="{$vo.id}">{$vo.carriername}</option>
					</volist>
				</select>
			</p>
			<p class="unit">
				<label style="margin-right: -10px;">接车人：</label> 
				<select name="userid" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="user" id="vo">
					<option value="{$vo.fullname}">{$vo.fullname}</option>
					</volist>
				</select>
			</p>
		<!-- 	<div class="unit">
				<label>车牌号：</label> <select name="carno" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="list4" id="vo">
					<option value="{$vo.carno}">{$vo.carno}</option>
					</volist>
				</select>
			</div> -->
			<div class="unit">
				<label>车牌号：</label> 
				<input type="text" name="carno">
			</div>
			<div class="unit">
				<label style="margin-right: -10px;">车辆状态(必填)：</label> 
				<select name="carstat" class="required combox">
					<option value="" selected>--请选择--</option>
					<option value="2">待发货</option>
				<!-- 车辆状态为2表示车待发货，等待输入吨数 -->
				</select>
			</div>
			<p class="unit" >
			
			<?php
			if(empty($product)){
               ?>
            <label style="margin-right: -10px;" id="cusproduct">产品名称：</label> 
				<select name="product" class="required combox">
					<option value="" selected>请选择(必填)</option>
					<volist name="goods" id="vo">
					<option value="{$vo.goodsname}">{$vo.goodsname}</option>
					</volist>
				</select>
            <?php
                }else{
             ?>
              <label  id="cusproduct">产品名称：</label> 
              <input type="text" name="product" value ="{$product}" readonly="readonly">
            <?php
                }
			?>
			</p>
			<!-- <p class="unit">
				<label>出厂净重(kg)：</label> <input type="text" name="sweight" class="digits" >
			</p> -->
			<!-- <div class="unit">
				<label>卸货净重(kg)：</label> <input type="text" name="eweight" class="digits" >
			</div>
			<div class="unit">
				<label>仓库提供(kg)：</label> <input type="text" 
					name="warehouse">
			</div>
				 
			<div class="unit">
				<label>供应商提供(kg)：</label> <input type="text" 
					name="supplier">
			</div> -->
			<!--
			<div class="unit">
				<label>已供货量(kg)：</label> <input type="text" 
					name="alshipment">
			</div>
			
			<div class="unit">
				<label>未供货量(kg)：</label> <input type="text" 
					name="notshipment">
			</div> -->
			<div class="unit">
				<label>调度时间：</label>
				<input type="text" name="controldate" class="date" dateFmt="yyyy-MM-dd HH:mm"/>
				<a class="inputDateButton" href="javascript:;">选择</a>
			</div>
			<div class="unit">
				<label>备注：</label>
				<TEXTAREA name="note" rows="3" cols="56" style="width: 360px;"></textarea>
			</div>
		</div>
		
		<div class="formBar">
			<ul>
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li><div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div></li>
			</ul>
		</div>
	</form>

</div>

